<template>
  <div class="course-page">
    <!-- 标题区 -->
    <div class="header-section">
      <h1>已加入课程</h1>
    </div>
    <!-- 课程卡片区 -->
    <div class="course-cards">
      <!-- 课程卡片1 -->
      <div class="course-card">
        <div class="card-header" style="background: linear-gradient(135deg, #a78bfa, #e684fa)">
          <div class="decorations">
            <div class="circle"></div>
            <div class="line"></div>
          </div>
        </div>
        <div class="card-content">
          <h3 class="course-name">思维创新与开发</h3>
          <p class="course-term">第2学期</p>
          <p class="course-teacher">董文良</p>
          <p class="course-id">编号：130025-022</p>
          <button 
            class="start-btn" 
            @click="$router.push({
              name: 'PracticeGraph',
              query: { 
                courseName: '思维创新与开发', 
                courseId: '130025-022'
              }
            })"
          >
            开始练习
          </button>
        </div>
      </div>
      <!-- 课程卡片2 -->
      <div class="course-card">
        <div class="card-header" style="background: linear-gradient(135deg, #a78bfa, #e684fa)">
          <div class="decorations">
            <div class="circle"></div>
            <div class="line"></div>
          </div>
        </div>
        <div class="card-content">
          <h3 class="course-name">宇宙探索基础</h3>
          <p class="course-term">第1学期</p>
          <p class="course-teacher">刘宇航</p>
          <p class="course-id">编号：130026-011</p>
          <button 
            class="start-btn" 
            @click="$router.push({
              name: 'PracticeGraph',
              query: { 
                courseName: '宇宙探索基础', 
                courseId: '130026-011'
              }
            })"
          >
            开始练习
          </button>
        </div>
      </div>
      <!-- 课程卡片3 -->
      <div class="course-card">
        <div class="card-header" style="background: linear-gradient(135deg, #a78bfa, #e684fa)">
          <div class="decorations">
            <div class="circle"></div>
            <div class="line"></div>
          </div>
        </div>
        <div class="card-content">
          <h3 class="course-name">星际生物科学</h3>
          <p class="course-term">第3学期</p>
          <p class="course-teacher">张生物</p>
          <p class="course-id">编号：130027-033</p>
          <button 
            class="start-btn" 
            @click="$router.push({
              name: 'PracticeGraph',
              query: { 
                courseName: '星际生物科学', 
                courseId: '130027-033'
              }
            })"
          >
            开始练习
          </button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 组件逻辑
</script>

<style scoped>
.course-page {
  padding: 2rem;
  width: 200vh;
  /* background-color: #1a1a1a; */
  min-height: calc(100vh - 70px);
}

.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-section h1 {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: white;
  margin-bottom: 0;
}

.course-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.course-card {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4), 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.card-header {
  height: 120px;
  position: relative;
}

.decorations {
  position: absolute;
  width: 100%;
  height: 100%;
}

.circle {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  top: 20px;
  left: 20px;
}

.line {
  position: absolute;
  width: 100px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  bottom: 30px;
  right: 20px;
  border-radius: 2px;
}

.card-content {
  background: white;
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-name {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #111;
  margin-bottom: 0.75rem;
}

.course-term,
.course-teacher,
.course-id {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #666;
  margin-bottom: 0.5rem;
}

.start-btn {
  background: #8b5cf6;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  margin-top: auto;
}

.start-btn:hover {
  background: #7c4dff;
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.material-icons {
  font-size: 18px;
}

@media (max-width: 768px) {
  .course-cards {
    grid-template-columns: 1fr;
  }
  
  .course-page {
    width: 100%;
    padding: 1rem;
  }
}
</style>
